﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;
using KPIS.GERP.Models.Class;

namespace KPIS.GERP.Models.ICM
{
    //public enum ComId{DN, BD, BDO, BDD, PPR, PR, PO}
    [DataContract, Table("IcmFile")]
    public class File
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "FileId", ResourceType = typeof(Resources.FileResource))]
        public int FileId { get; set; }

        [CustomRequired]
        [DataMember, Display(Name = "RefId", ResourceType = typeof(Resources.FileResource))]
        public int RefId { get; set; }

        [CustomRequired]
        [ForeignKey("SysProcess")]
        [DataMember, Display(Name = "RefType", ResourceType = typeof(Resources.FileResource))]
        public int RefType { get; set; }
        
        [CustomRequired]
        [DataMember, Display(Name = "FileName", ResourceType = typeof(Resources.FileResource))]
        public string FileName { get; set; }

        [DataMember, Display(Name = "FileDescription", ResourceType = typeof(Resources.FileResource))]
        public string FileDescription { get; set; }

        [CustomRequired]
        [DataMember, Display(Name = "FilePath", ResourceType = typeof(Resources.FileResource))]
        public string FilePath { get; set; }

        [CustomRequired]
        [DataMember, Display(Name = "FileType", ResourceType = typeof(Resources.FileResource))]
        public string FileType { get; set; }

        [CustomRequired]
        [DataMember, Display(Name = "FileExtention", ResourceType = typeof(Resources.FileResource))]
        public string FileExtention { get; set; }

        [DataMember, Display(Name = "FileSizeByte", ResourceType = typeof(Resources.FileResource))]
        public double FileSizeByte { get; set; }

        [DataMember, Display(Name = "FileDownloadCount", ResourceType = typeof(Resources.FileResource))]
        public int FileDownloadCount { get; set; }

        #region RecordStatus

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        public int? CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        public DateTime? CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        public int? UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        public DateTime? UpdatedWhen { get; set; }

        #endregion

        [DataMember]
        public IcmMasLookUp SysProcess { get; set; }

        //[DataMember]
        //public MasLookUp CommitteePosition { get; set; }

        [DataMember]
        public HRM.Employee Employee { get; set; }
    }
}
